
<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="css/project.css" type="text/css" />
	<link rel="stylesheet" href="css/index.css" type="text/css" />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=no"> 
	<meta name="apple-mobile-web-app-capable" content="yes"> 
	<meta name="apple-mobile-web-app-status-bar-style" content="black"> 
	<meta name="format-detection" content="telephone=no"> 
	<script type="text/javascript" src="js/zepto.min.js"></script>
	<script type="text/javascript" src="js/util.js"></script>
    <script type="text/javascript">
   		document.addEventListener('plusready', function(){
   			//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"
   			
   		});
   		
    </script>
    
</head>
<body class="back-img">
	<img src="img/01.jpg" class="back-img"> 
	<div id="body1">
		
			<div class="body-fontfamily">
			<div class="user-info">
					<embed id="user_img" src="img/user.svg" width="25" height="25" type="image/svg+xml" style="vertical-align: middle"/>
					<input class="uname" id="username" type="text" placeholder="请输入用户名" value="" required="required"/><br />
					<embed id="upwd_img" src="img/pwd.svg" width="25" height="25" type="image/svg+xml" style="vertical-align: middle"/>
					<input class="upwd"  id="password" type="password" placeholder="密码" value="" required="required"/>
			</div>
		</div>
		<div class="login">
			<input class="user_login" type="button" value="登录"/>
		</div>
		
		<div class="pwd_reg">
			<p>
				<a class="forget_pwd" href="reg.html">新用户注册</a>&nbsp;&nbsp;|&nbsp;&nbsp;
				<a class="new_reg" href="pwd_recovery.html">忘记密码</a>
			</p>
		</div>
</body>
<script src="js/mui.min.js"></script>
<script src="js/app.js"></script>
<script>
	$(function(){
		$(function(){
		var height=window.innerHeight;
		var width=window.innerWidth;
		var body=$('.back-img-1');
		body[0].style.height = height+"px";
		body[0].style.width = width+"px";
		
		
		$(".user_login").on('touchend',function(){
			var username = $("#username").val();
			var password = $("#password").val();
			var param = {title:'提示',text:'',callback:function(){this.remove();}}
			if(!username){
				param.text = "请输入用户名！";
				iAlert(param);
				return;
			}
			if(!password){
				param.text = "请输入密码！";
				iAlert(param);
				return;
			}
			/*$.getJSON("localhost:8080/WBPlatform/user/login.do").then(function(obj){
				console.log(obj);
			});*/
			$.ajax({
				"url": "http://192.168.0.102/WBPlatform/user/main.do",
				"data": "username="+username+"&password="+password,
				"type": "POST", 
				"dataType": "json", 
				"xhrFields": {
           			withCredentials: true
       			},
       			"crossDomain": true,
				"success": function(obj) {
					if(obj.state==1){
						console.log(obj.message);
						location.href="index.html";
					}else{
						param.text = obj.message;
						iAlert(param);
					}
				}
			});
		});
	});
	
</script>
</html>